package fictional.Common;

/***
 * Represents a Gender item. 
 */
public class GenderItem extends DBItem implements Comparable<GenderItem> {

	/**
	 * Returns a new GenderItem object
	 * @param id The id
	 * @param mid The mid
	 */
	public GenderItem(int id, String mid,String name) {
		super(id, mid);
		this.gender = name;
	}
	
	public GenderItem(int id, String mid) {
		super(id,mid);
	}

	/**
	 * Sets the gender name associated with this instance
	 * @param gender The gender's name string
	 */
	public void setGender(String gender) {
		this.gender = gender;
	}
	/***
	 * Gets the gender name associated with this instance
	 * @return The gender's name string
	 */
	public String getGender() {
		return gender;
	}
	
	@Override
	public String toString()
	{
		return getGender();
	}
	
	public int compareTo(GenderItem s) {
		if (s.getGender().equals(this.gender))
			return 0;
		else
			return (s.getGender().compareTo(this.getGender())) < 1 ? 1 : -1;
	}

	private String gender;
}
